import { createRouter, createWebHashHistory } from 'vue-router'

import appHome from '../views/Home.vue'
import Home from '../views/daohangViews/Home.vue'
import All from '../views/daohangViews/All.vue'
import My from '../views/daohangViews/My.vue'
import Star from '../views/daohangViews/Star.vue'
import Delete from '../views/daohangViews/Delete.vue'
import Details from '../views/daohangViews/Details.vue'


import HomeView from '../views/HomeView.vue'
import Children from '../views/Children.vue'
import Login from '../views/Login.vue'

const router = createRouter({
  mode: 'history',
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/edit/:children',
      name: 'edit',
      component: HomeView,
    },
    {
      path: '/',
      // name: '/',
      redirect: '/home',
      component: appHome,
      children: [
        {
          path: '/home',
          name: 'home',
          component: Home,
        },
        {
          path: '/all',
          name: 'all',
          component: All,
        },
        {
          path: '/my',
          name: 'my',
          component: My,
        },
        {
          path: '/star',
          name: 'star',
          component: Star,
        },
        {
          path: '/delete',
          name: 'delete',
          component: Delete,
        },
        {
          path: '/details/:children',
          name: 'details',
          component: Details,
        },
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    }
  ]
})

export default router
